import React from "react";
import PropTypes from "prop-types";

class TheLabel extends React.Component {
    render() {
        const {
            type,
            value
        } = this.props;
        const typeList = {
            R: '注册会员',
            P: '正式会员',
            S: '商户会员'
        }
        const statusList = {
            Y: '● 正常',
            N: '● 冻结'
        }
        return <>
            {
                type === 'type' && <span
                    style={{color: value === 'R' ? '#f59a23' : value === 'S' ? '#00bfbf' : '#000'}}>{typeList[value]}</span>
            }
            {
                type === 'status' &&
                <span style={{color: value === 'N' ? '#fa5251' : '#05c160'}}>{statusList[value]}</span>
            }
        </>
    }
}

TheLabel.propTypes = {
    type: PropTypes.string,
    value: PropTypes.string
};
TheLabel.defaultProps = {
    type: '',
    value: ''
};
export default TheLabel;
